#!/usr/bin/env python
#-*- coding:utf-8 -*-

# file: template.py

import sys

def fact(n):
    if n < 2:
        return 1

    return n * fact(n -1)


def read_input(filename):
    f = open(filename, "r")
    lines = f.readlines()
    f.close()

    values = []
    for line in lines:
        item = tuple([int(n) for n in line.split(' ')])
        values.append(item)

    return values


def main():
    if len(sys.argv) > 1:
        input_file = sys.argv[1]
    else:
        input_file = sys.argv[0]
        start = input_file.rfind('/') + 1
        end = input_file.rfind('.py')
        input_file = input_file[start:end] + '.in'

    try:
        input = read_input(input_file)
    except IOError, e:
        print 'Arquivo de entrada "%s" nao encontrado.' % \
                input_file
        sys.exit(1)

    for data in input:
        n, m = data
        c = fact(n) / (fact(n - m) * fact(m))
        print c


if __name__ == '__main__':
    main()

